package IteratorAndComposite.entry;

import IteratorAndComposite.IteratorInterfaces.Menu;
import IteratorAndComposite.IteratorInterfacesImpl.PancakeHouseIterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: pengzx
 * @Description:
 * @Date: 14:12 2017/9/19
 * @Modified by: 1.0
 */
public class PancakeHouseMenu implements Menu {
    private List menuItemList;

    public PancakeHouseMenu()
    {
        menuItemList = new ArrayList(0);
        addItem("鸡蛋煎饼","鸡蛋加煎饼",false,2.99);
        addItem("葱花煎饼","葱加煎饼",false,2.99);
        addItem("青菜煎饼","青菜加煎饼",true,3.49);
        addItem("牛肉煎饼","牛肉加煎饼",false,3.99);
    }

    public void addItem(String name, String destription,boolean vegetarian, double price)
    {
        MenuItem menuItem = new MenuItem(name,destription,vegetarian,price);
        menuItemList.add(menuItem);
    }

    @Deprecated
    public List getMenuItemList()
    {
        return menuItemList;
    }

    @Override
    public java.util.Iterator createIterator(){
        return new PancakeHouseIterator(menuItemList);
    }

    //其他的方法
}
